library(readxl)
mydata <- read_xlsx("./Skills.xlsx")
mydata <- as.data.frame(mydata)
head(mydata)
## ID Time Course
## 1 1 59 A
## 2 2 50 A
## 3 3 45 A
## 4 4 55 A
## 5 5 35 A
## 6 6 28 A
Description:
mydata$CourseF <- as.factor(mydata$Course)
library(dplyr) # Loads the dplyr package for data manipulation
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
##
## recode
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
mydata %>% # Pipes the dataset to the next operation
group_by(CourseF) %>% # Groups observations by course
summarise(
n = n(), # Number of employees per course
mean_time = mean(Time), # Mean completion time
sd_time = sd(Time), # Standard deviation of completion time
median_time = median(Time), # Median completion time
min_time = min(Time), # Minimum completion time
max_time = max(Time) # Maximum completion time
)
## # A tibble: 3 × 7
## CourseF n mean_time sd_time median_time min_time max_time
## <fct> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 A 10 41.5 10.6 39.5 28 59
## 2 B 10 37 10.4 40.5 18 50
## 3 C 10 26.8 8.84 24 15 39
library(ggplot2)
ggplot(mydata, aes(x = Course, y = Time)) +
geom_violin(fill = "grey90", alpha = 0.6, trim = FALSE) +
geom_boxplot(width = 0.1, fill = "grey60", outlier.shape = 16) +
labs(
title = "Distribution of Problem-Solving Time Across Training Courses",
x = "Training course",
y = "Time required to solve the problem (minutes)"
) +
theme_bw()
library(car)
leveneTest(mydata$Time, mydata$CourseF)
## Levene's Test for Homogeneity of Variance (center = median)
## Df F value Pr(>F)
## group 2 0.0643 0.9378
## 27
library(onewaytests)
welch.test(Time ~ CourseF,
data = mydata)
##
## Welch's Heteroscedastic F Test
##
## data: Time and CourseF
## F = 6.0276, num df = 2.000, denom df = 17.875, p-value =
## 0.009982
library(dplyr)
library(rstatix)
##
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
##
## filter
mydata %>%
group_by(CourseF) %>%
shapiro_test(Time)
## # A tibble: 3 × 4
## CourseF variable statistic p
## <fct> <chr> <dbl> <dbl>
## 1 A Time 0.946 0.618
## 2 B Time 0.896 0.200
## 3 C Time 0.889 0.166
results <- aov(Time ~ CourseF,
data = mydata)
summary(results)
## Df Sum Sq Mean Sq F value Pr(>F)
## CourseF 2 1135 567.3 5.724 0.00847 **
## Residuals 27 2676 99.1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
library(effectsize)
##
## Attaching package: 'effectsize'
## The following objects are masked from 'package:rstatix':
##
## cohens_d, eta_squared, omega_squared
eta_squared(results)
## For one-way between subjects designs, partial eta squared is
## equivalent to eta squared. Returning eta squared.
## # Effect Size for ANOVA
##
## Parameter | Eta2 | 95% CI
## -------------------------------
## CourseF | 0.30 | [0.06, 1.00]
##
## - One-sided CIs: upper bound fixed at [1.00].
interpret_eta_squared(0.30, rules = "cohen1992")
## [1] "large"
## (Rules: cohen1992)
pairwise.t.test(mydata$Time, g = mydata$CourseF,
paired = FALSE,
p.adj = "bonferroni")
##
## Pairwise comparisons using t tests with pooled SD
##
## data: mydata$Time and mydata$CourseF
##
## A B
## B 0.9634 -
## C 0.0081 0.0900
##
## P value adjustment method: bonferroni